package com.ecommerce.dal.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ecommerce.dal.dao.IUserRoleDAO;
import com.ecommerce.dal.entity.UserRole;
import com.ecommerce.dal.service.IUserRoleManagementService;

@Service("userRoleManagementService")
public class UserRoleManagementService implements IUserRoleManagementService {

	@Autowired
	private IUserRoleDAO userRoleDAO;
	
	@Override
	public void save(UserRole userRole) {
		userRoleDAO.save(userRole);
	}

	@Override
	public void update(UserRole userRole) {
		userRoleDAO.update(userRole);
	}

	@Override
	public void delete(UserRole userRole) {
		userRoleDAO.delete(userRole);
	}

	@Override
	public List<UserRole> findByUserRoleId(long userRoleId) {
		return userRoleDAO.findByUserRoleId(userRoleId);
	}

	@Override
	public List<UserRole> findByAuthority(String authority) {
		return userRoleDAO.findByAuthority(authority);
	}
}
